import { defHttp } from '@/utils/http/axios'

import type {
  DictTypeAddReq,
  DictTypeDeleteReq,
  DictTypeQuery,
  DictTypeUpdateReq,
} from '@/model/sys/dictTypeModel'

enum Path {
  Tree = '/dict-type/tree',
  Add = '/dict-type/add',
  Update = '/dict-type/update',
  Delete = '/dict-type/delete',
}

export const dictTypeApi = {
  tree(params?: DictTypeQuery) {
    return defHttp.post({ url: Path.Tree, params })
  },
  add(params: DictTypeAddReq) {
    return defHttp.post({ url: Path.Add, params })
  },
  update(params: DictTypeUpdateReq) {
    return defHttp.post({ url: Path.Update, params })
  },
  delete(params: DictTypeDeleteReq) {
    return defHttp.post({ url: Path.Delete, params })
  },
}
